﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lidgren.Network;
using Model.Extensions;

namespace Model.LiveControl
{
    public  struct FileItem:ISerializable
    {
        public String FileName;
        public String SourceFileName;
        public DateTime WriteTime;
        public Int64 FileSize;
        public bool IsFolder;
        public void WritePayload(NetOutgoingMessage message)
        {
            message.Write(FileName);
            message.Write(SourceFileName);
            message.Write(WriteTime);
            message.Write(FileSize);
            message.Write(IsFolder);
        }

        public void ReadPayload(NetIncomingMessage message)
        {
            FileName = message.ReadString();
            SourceFileName = message.ReadString();
            WriteTime = message.ReadDateTime();
            FileSize = message.ReadInt64();
            IsFolder = message.ReadBoolean();
        }
    }
}
